package com.zretc.admin.dao;


import com.zretc.api.pojo.Activity;
import com.zretc.api.pojo.SysUser;
import com.zretc.api.pojo.adminModule.Announcement;
import com.zretc.api.pojo.recommendModule.Recommend;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;

@Mapper
public interface AdminMapper {
    boolean approvalRecommend(@Param("recommendId")Integer recommendId,@Param("status") Integer status);

    boolean deleteRecommend(Integer recommendId);

    void approvalActivity(@Param("activityId")Integer activityId,@Param("status") Integer status);

    boolean deleteActivity(Integer activityId);

    boolean approvalBlog(@Param("blogId") Long blogId, @Param("status") Byte status);

    boolean deleteBlog(Long blogId);

    Integer getRecommendCount();

    ArrayList<Recommend> queryAllRecommendByPage(@Param("startIndex") Integer startIndex,
                                     @Param("pageSize")Integer pageSize, @Param("status")Integer status);

    Integer getActivityCount();

    ArrayList<Activity> queryAllActivityPage(@Param("startIndex") Integer startIndex,@Param("pageSize") Integer pageSize,@Param("status") Integer status);

    Integer getBlogCount();

    ArrayList<Activity> queryAllBlogPage(@Param("startIndex") Integer startIndex,@Param("pageSize") Integer pageSize,@Param("status") Integer status);

    void addAnnouncement(Announcement announcement);

    void delAnnouncement(Integer announcementId);

    Integer getAnnoCount();

    ArrayList<Announcement> queryAllAnnoPage(@Param("startIndex") Integer startIndex,@Param("pageSize") Integer pageSize,@Param("is_deleted") Integer is_deleted);

    Integer getUserCount();

    ArrayList<SysUser> queryAllUserPage(@Param("startIndex")Integer startIndex,@Param("pageSize") Integer pageSize,@Param("role") String role);

    boolean deleteUser(Integer userId);

    boolean updateUser(@Param("userId") Integer userId,@Param("role") Integer role);

    Integer getUserIdByRecommendId(Integer recommendId);

    int getUserIdByActivityId(Integer activityId);

    int getUserIdByBlogId(Long blogId);
}
